<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../angular.min.js"></script>
<style>
	input.ng-invalid {
		background-color : lightblue;
	}
/*
	ng-model 指令根据表单域的状态添加/移除以下类：
	ng-empty
	ng-not-empty
	ng-touched
	ng-untouched
	ng-valid
	ng-invalid
	ng-dirty
	ng-pending
	ng-pristine
*/
</style>
</head>
<body>
	
	<form ng-app='' name='myForm' ng-init=''>
		Email:<input type="email" ng-model='myText' name='myAdr' required >
		<p>编辑邮箱地址，查看状态的改变。</p>
		<h1>状态</h1>
		<p>Vailid:{{myForm.myAdr.$valid}} (如果输入的值是合法的则为 true)。</p>
		<p>Dirty: {{myForm.myAdr.$dirty}} (如果值改变则为 true)。</p>
		<p>Touched: {{myForm.myAdr.$touched}} (如果通过触屏点击则为 true)。</p>
	</form>
</body>
</html>

